Attribute VB_Name = "MergeCellsRow"
Option Explicit

Function MergeCellsRow(ByVal active_cell As Range) As String

    '
    ' find row in merge cells
    '
    Dim detect_row_number As Integer
    Dim merge_cells_address As String
    
    For detect_row_number = active_cell.row To 1 Step -1
        If ActiveSheet.Cells(detect_row_number, active_cell.Column).MergeCells = True Then
                merge_cells_address = ActiveSheet.Cells(detect_row_number, active_cell.Column).address
                MergeCellsRow = Split(merge_cells_address, "$")(2)
                Exit For
            End If
        Next detect_row_number
End Function
